package com.wms.controller.admin;

import com.jfinal.aop.Inject;
import com.jfinal.plugin.activerecord.Page;
import com.wms.common.utils.StringUtils;
import com.wms.core.model.SysAdmin;
import com.wms.core.model.SysLogininfor;
import com.wms.core.service.SysLogininforService;
import com.wms.framework.domain.AjaxResult;
import io.jboot.db.model.Columns;
import io.jboot.web.controller.JbootController;
import io.jboot.web.controller.annotation.RequestMapping;

@RequestMapping("/admin/sys/login/log")
public class SysLogininforController extends JbootController {
    @Inject
    private SysLogininforService sysLogininforService;
    public AjaxResult lists(){
        Integer page=getInt("page",1);
        Integer pageSize=getInt("pageSize",15);
        String userName=getPara("userName");
        Columns columns=Columns.create();
        if(StringUtils.isNotBlank(userName)){
            columns.eq("user_name",userName);
        }
        Page<SysLogininfor> list=sysLogininforService.paginateByColumns(page,pageSize,columns);
        return AjaxResult.success("成功",list);
    }
}
